package com.atguigu01._this.ex2;

public class Bank {
    private Customer[] customers;
    private  int numberofcustomers;

    public Bank() {
        customers=new Customer[10];
        this.numberofcustomers=0;
    }

    public void addcustomer(String f,String l){
        Customer customer=new Customer(f,l);
        customers[numberofcustomers]=customer;
        numberofcustomers++;
    }

    public int getNumberofcustomers() {
        return numberofcustomers;
    }

    public Customer getCustomers(int index) {
        if(index<0||index>=numberofcustomers){
            return null;
        }
        return customers[index];
    }
}
